package com.heyige.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("prompt_templates")
public class PromptTemplate {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("title")
    private String title;
    
    @TableField("description")
    private String description;
    
    @TableField("category")
    private String category;
    
    @TableField("type")
    private String type = TemplateType.GENERAL.name();
    
    @TableField("content")
    private String content;
    
    @TableField("variables")
    private String variables;
    
    @TableField("tags")
    private String tags;
    
    @TableField("is_public")
    private Boolean isPublic = true;
    
    @TableField("is_active")
    private Boolean isActive = true;
    
    @TableField("user_id")
    private Long userId;
    
    @TableField("usage_count")
    private Integer usageCount = 0;
    
    @TableField("sort_order")
    private Integer sortOrder = 0;
    
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
    
    public enum TemplateType {
        GENERAL,        // 通用
        CODE,           // 代码
        WRITING,        // 写作
        TRANSLATION,    // 翻译
        MARKETING,      // 营销
        EDUCATION,      // 教育
        RED_BOOK,       // 小红书
        OTHER           // 其他
    }
}